package cn.lg.soar.boot.fc.tool;

public class LesseemanageValidation {

    //手机号校验
    public static boolean isValidPhone(String phone) {
        String pattern = "^1[3|4|5|6|7|8|9]\\d{9}$";
        return phone.matches(pattern);
    }

    //居民身份证校验
    public static boolean isValidIDcard(String IDcard) {
        String patter = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";
        return IDcard.matches(patter);
    }

    //护照校验
    public static boolean isValidpassport(String passport) {
        String patter = "^(?:[EeSs][a-zA-Z0-9]{7,8}|\\d{9}|[A-Za-z]?\\d{8,9}|[a-zA-Z0-9]{6,12})$";
        return passport.matches(patter);
    }

    //港澳居民来往内地通行证校验
    public static boolean isValidGajmtxz(String gattxznumber) {
        String patter = "^(?:[HMhm]\\d{10}|[HMhm]\\d{8}[A-Za-z0-9]\\d{8})$";
        return gattxznumber.matches(patter);
    }

    //台湾居民来往大陆通行证校验
    public static boolean isValidTwtxz(String twtxz) {
        String patter = "^\\d{8}(\\d{1})?$";
        return twtxz.matches(patter);
    }



}
